/*
 * Copyright (C),2015-2016. 中锐
 * FileName: JsonMessageConverter.java
 * Author:   zhengyong
 * Date:     2016-01-07 23:26:31
 * Description: //模块目的、功能描述
 * History: //修改记录 修改人姓名 修改时间 版本号 描述
 * <zhengyong>  <2016-01-07 23:26:31> <version>   <desc>
 */

package com.demo.commons;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder;

/**
 * <一句话功能简述>
 * <功能详细描述>
 *
 * @author ZhengYong
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
public class JsonMessageConverter extends AbstractJackson2HttpMessageConverter {
    public JsonMessageConverter() {
        this(Jackson2ObjectMapperBuilder.json().build());
    }

    public JsonMessageConverter(ObjectMapper objectMapper) {
        super(objectMapper, new MediaType[]{new MediaType("application", "json", DEFAULT_CHARSET), new MediaType("application", "*+json", DEFAULT_CHARSET)});
    }

}
